#include <dft.h>


#undef __FUNCT__
#define __FUNCT__ "DFTCreate"
PetscErrorCode DFTCreate(DA da, PetscReal R[], PetscReal z[], PetscReal T, DFT **dft)
{
  PetscErrorCode ierr;
  PetscFunctionBegin;
  ierr = PetscMalloc(sizeof(DFT), dft); CHKERRQ(ierr);
  ierr = DFTFFTCreate(da, R, T, *dft); CHKERRQ(ierr);
  ierr = DFTHardSphereCreate(*dft); CHKERRQ(ierr);
  PetscFunctionReturn(0);
}// DFTCreate()

#undef __FUNCT__
#define __FUNCT__ "DFTDestroy"
PetscErrorCode DFTDestroy(DFT *dft) {
  PetscErrorCode ierr;
  PetscFunctionBegin;
  ierr = DFTHardSphereDestroy(dft); CHKERRQ(ierr);
  ierr = DFTFFTDestroy(dft); CHKERRQ(ierr);
  ierr = PetscFree(dft); CHKERRQ(ierr);
  PetscFunctionReturn(0);
}// DFTDestroy()

#undef __FUNCT__
#define __FUNCT__ "DFTCalculateMuHS"
PetscErrorCode DFTCalculateMuHS(DFT *dft, Vec rho, Vec muHS){
  PetscErrorCode ierr;
  PetscFunctionBegin;
  ierr = DFTHardSphereCalculateMu(dft, rho, muHS); CHKERRQ(ierr);
  PetscFunctionReturn(0);
}
